package developer.核心类.集合;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author zhangyongkang
 * @time 2025/7/21 20:29
 * @description
 *                  *
 *                 *  *
 *                *  *  *
 */
public class HashMapTest {

    public static void main(String[] args) {
        HashMap<String, String> map = new HashMap<>();
        map.put("1", "a");
        map.remove("1");
        ConcurrentHashMap<String, String> m = new ConcurrentHashMap<>();
        m.put("1", "a");
    }

    private static void method1() {
        CopyOnWriteArrayList<Object> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
        copyOnWriteArrayList.add(1);
        copyOnWriteArrayList.get(1);
    }

    private static void method2() {
        ConcurrentHashMap<Object, Object> concurrentHashMap = new ConcurrentHashMap<>();
        concurrentHashMap.put("x", "x");
        concurrentHashMap.get("x");
    }
}
